Microsoft graph api error "You do not have permissions to open this file in the browser."

developeruser 5 Reputation points
2024-05-13T15:01:27.7+00:00

There was no problem when I first created the microsoft account. After some time passed, when I tried to request again, I got an error.

I send a request to this endpoint and the following error is returned.

"https://graph.microsoft.com/v1.0/me/drive/items/{drive-item-id}/workbook/worksheets"

{"error":{"code":"FileOpenUserUnauthorized","message":"You do not have permissions to open this file in the browser.","innerError":{"code":"unauthorizedUncategorized","message":"Required authentication information for the resource is either missing or invalid.","innerError":{"code":"FileOpenUserUnauthorized","message":"You do not have permissions to open this file in the browser."},"date":"2024-05-13T14:34:36","request-id":"f6e36068-3345-4a70-88f2-22aeb0fd1c23","client-request-id":"f6e36068-3345-4a70-88f2-22aeb0fd1c23"}}}


I gave all the necessary permissions.

Screenshot 2024-05-13 at 17.56.47

I don't know what is the problem. Please, help me :(

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,873 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 37,871 Reputation points
    2024-05-14T02:13:32.76+00:00

    Hi @developeruser

    It is only available in a delegated context. Try assigning the Files.ReadWrite delegated permission to the calling app, and then request an access token using a delegated authentication flow with user participation.

    User's image

    Or log in to Graph Explorer with your user and call this API directly.

    59376133-2c72-4edc-b2f7-24ddcb64a632

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


  2. wang 0 Reputation points
    2024-05-16T03:54:22.5433333+00:00

    Hi @CarlZhao-MSFT

    I also have the same problem. Yesterday was fine, but not today

    0 comments No comments